using System;

namespace CSW.Framework.Common.Utils
{
    /// <summary>
    /// Helper methods
    /// </summary>
    public static class Unsorted
    {
        /// <summary>
        /// Gets a value indicating whether the application is running on a terminal service session.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if the application is running on a terminal service session; otherwise, <c>false</c>.
        /// </value>
        public static bool IsTerminalServiceSession
        {
            get
            {
                string clientName = Environment.ExpandEnvironmentVariables("%ClientName%").ToUpper();
                string computerName = Environment.ExpandEnvironmentVariables("%ComputerName%").ToUpper();

                if (clientName != "%CLIENTNAME%" && clientName != "CONSOLE" && clientName != computerName)
                {
                    return true;
                }

                return false;
            }
        }
    }
}